package com.software.myopiaparents.http;


import com.software.myopiaparents.bean.AlertListInfo;
import com.software.myopiaparents.bean.BaseInfo;
import com.software.myopiaparents.bean.DeviceListInfo;
import com.software.myopiaparents.bean.LoginInfo;

import java.util.Map;

import io.reactivex.Flowable;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.HeaderMap;
import retrofit2.http.POST;

public interface ApiService {

    /*
     * @Query，@QueryMap，@Field，@FieldMap，@FormUrlEncoded，@Path，@Url
     * get使用@QueryMap  post使用@FieldMap
     * */

    // 获取url
//    @GET("android/data")
//    Flowable<BaseInfo> getUrlType();

    //发送验证码
    @FormUrlEncoded
    @POST("parent/Login/mobileCode")
    Flowable<BaseInfo> getCode(@FieldMap Map<String, String> params);

    //注册
    @FormUrlEncoded
    @POST("parent/Login/register")
    Flowable<BaseInfo> getRegister(@FieldMap Map<String, String> params);

    //登录
    @FormUrlEncoded
    @POST("parent/Login/index")
    Flowable<LoginInfo> getLogin(@FieldMap Map<String, String> params);

    //找回密码
    @FormUrlEncoded
    @POST("parent/Login/retrievePwd")
    Flowable<BaseInfo> getForgetPwd(@FieldMap Map<String, String> params);

    //第三方登录
    @FormUrlEncoded
    @POST("parent/Login/thirdLogin")
    Flowable<LoginInfo> getThirdLogin(@FieldMap Map<String, String> params);

    //绑定手机
    @FormUrlEncoded
    @POST("parent/index/bindingMobile")
    Flowable<LoginInfo> getBindMobile(@FieldMap Map<String, String> params);

    //修改密码
    @FormUrlEncoded
    @POST("parent/index/editPwd")
    Flowable<BaseInfo> getUpdatePwd(@HeaderMap Map<String, String> headers, @FieldMap Map<String, String> params);

    //设备列表
    @GET("parent/Index/deviceList")
    Flowable<DeviceListInfo> getDeviceList(@HeaderMap Map<String, String> headers);

    //绑定设备
    @FormUrlEncoded
    @POST("parent/index/binding")
    Flowable<BaseInfo> getBindDevice(@HeaderMap Map<String, String> headers, @FieldMap Map<String, String> params);

    //解绑设备
    @FormUrlEncoded
    @POST("parent/index/unbindingDevice")
    Flowable<BaseInfo> getUnBindDevice(@HeaderMap Map<String, String> headers, @FieldMap Map<String, String> params);

    //修改设备名
    @FormUrlEncoded
    @POST("parent/index/editDeviceName")
    Flowable<BaseInfo> getEditDeviceName(@HeaderMap Map<String, String> headers, @FieldMap Map<String, String> params);


    //修改昵称
    @FormUrlEncoded
    @POST("parent/index/editNickname")
    Flowable<BaseInfo> getEditNickname(@HeaderMap Map<String, String> headers, @FieldMap Map<String, String> params);

    //用户信息
    @GET("parent/index/userInfo")
    Flowable<LoginInfo> getUserInfo(@HeaderMap Map<String, String> headers);


    //警报列表
    @FormUrlEncoded
    @POST("parent/Index/alertList")
    Flowable<AlertListInfo> getAlertList(@HeaderMap Map<String, String> headers, @FieldMap Map<String, String> params);

    //添加友盟device_token
    @FormUrlEncoded
    @POST("parent/index/addDeviceToken")
    Flowable<BaseInfo> getDeviceToken(@HeaderMap Map<String, String> headers, @FieldMap Map<String, String> params);






}
